// packageA/member/coupon_v2/couponComm/handCoupon/handCoupon.js
var app = getApp();
const skinBehavior = require("../../../../../utils/themeSkin/skinBehavior");
Component({
  behaviors: [skinBehavior],
  /**
   * 组件的属性列表
   */
  options: {
    addGlobalClass: true
  },
  properties: {
    handShow:Boolean,
    handQuery:{
      type:Object,
      value:{}
    },
    iPnoneBottomBol:Boolean
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    inputChange(event) {
      let {name} = event.currentTarget.dataset;
      this.triggerEvent('inputChange', {name:name,value:event.detail})
    },
    handClose() {
      this.setData({
        handShow:false
      })
    },
    handConfrim() {
      if(app._isTextEmpty(this.data.handQuery.name)) {
        wx.showToast({
          icon: 'none',
          title: '请输入领取人姓名',
          duration: 1500
        });
        return;
      }
      if(app._isTextEmpty(this.data.handQuery.mobile)) {
        wx.showToast({
          icon: 'none',
          title: '请输入领取人的手机号码',
          duration: 1500
        });
        return;
      }
      if(app._isTextEmpty(this.data.handQuery.verifyMobile)) {
        wx.showToast({
          icon: 'none',
          title: '请确认领取人的手机号码',
          duration: 1500
        });
        return;
      }
      if(this.data.handQuery.verifyMobile != this.data.handQuery.mobile) {
        wx.showToast({
          icon: 'none',
          title: '手机号码有误，请重新输入',
          duration: 1500
        });
        return;
      }
      this.setData({
        handShow:false,
      })
      this.triggerEvent('handConfrim');
    }
  }
})